import request from '../utils/request.js';

export function findAllMenu() {
  return request({
    url: '/api/rbacMenu/',
    method: 'get',
  })
}
export function editOne(data) {
  return request({
    url: '/api/rbacMenu/',
    method: 'put',
    data
  })
}

export function updateMenu(id,fid) {
  return request({
    url: '/api/rbacMenu/'+id+'/'+fid,
    method: 'put',
  })
}

export function getMenuIds(rid) {
  return request({
      url: '/api/rbacMenu/getIds/'+rid,
      method: 'get',
  })
}

export function findMenuIdsByRoleId(rid) {
  return request({
      url: '/api/rbacMenu/findMenuIdsByRoleId/'+rid,
      method: 'get',
  })
}

export function addMenu(rid, ids) {
  return request({
      url: '/api/rbacMenu/' + rid + '/' + ids,
      method: 'post',
  })
}

export function deleteMenu(rid, ids) {
  return request({
      url: '/api/rbacMenu/del/' + rid + '/' + ids,
      method: 'post',
  })
}

export function findMenuById(id) {

  return request({
      url: '/api/rbacMenu/findMenuById/'+id,
      method: 'get',
  })
}